﻿using EnglishAuction.BUS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EnglishAuction
{
    public partial class Template2 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CurrentUser"] != null)
            {
                NguoiDung nguoiDung = Session["CurrentUser"] as NguoiDung;
                notLogin.Visible = false;
                login.Visible = true;
                nameUserCurrent.Text = nguoiDung.HoTen;
                if (nguoiDung.LoaiNguoiDungId.Value == 1)
                {
                    string script = "$(function(){showMenuSeller();});";
                    ScriptManager.RegisterStartupScript(this, this.Page.GetType(), "seller", script, true);
                }
                else if (nguoiDung.LoaiNguoiDungId.Value == 2)
                {
                    string script = "$(function(){showMenuBougher();});";
                    ScriptManager.RegisterStartupScript(this, this.Page.GetType(), "seller", script, true);
                }
            }
            else
            {
                notLogin.Visible = !false;
                login.Visible = !true;
            }
        }
    }
}